/**
 * <copyright>
 * </copyright>
 *

 */
package hu.bme.mit.androtext.androapp.androAppDsl.impl;

import hu.bme.mit.androtext.androapp.androAppDsl.Activity;
import hu.bme.mit.androtext.androapp.androAppDsl.AndroAppDslFactory;
import hu.bme.mit.androtext.androapp.androAppDsl.AndroAppDslPackage;
import hu.bme.mit.androtext.androapp.androAppDsl.AndroidApplication;
import hu.bme.mit.androtext.androapp.androAppDsl.ModelElement;

import hu.bme.mit.androtext.androdata.androDataDsl.AndroDataDslPackage;

import hu.bme.mit.androtext.androgui.androGuiDsl.AndroGuiDslPackage;

import hu.bme.mit.androtext.common.commons.CommonsPackage;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class AndroAppDslPackageImpl extends EPackageImpl implements AndroAppDslPackage
{
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass androidApplicationEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass modelElementEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass activityEClass = null;

  /**
   * Creates an instance of the model <b>Package</b>, registered with
   * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
   * package URI value.
   * <p>Note: the correct way to create the package is via the static
   * factory method {@link #init init()}, which also performs
   * initialization of the package, or returns the registered package,
   * if one already exists.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see org.eclipse.emf.ecore.EPackage.Registry
   * @see hu.bme.mit.androtext.androapp.androAppDsl.AndroAppDslPackage#eNS_URI
   * @see #init()
   * @generated
   */
  private AndroAppDslPackageImpl()
  {
    super(eNS_URI, AndroAppDslFactory.eINSTANCE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private static boolean isInited = false;

  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
   * 
   * <p>This method is used to initialize {@link AndroAppDslPackage#eINSTANCE} when that field is accessed.
   * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static AndroAppDslPackage init()
  {
    if (isInited) return (AndroAppDslPackage)EPackage.Registry.INSTANCE.getEPackage(AndroAppDslPackage.eNS_URI);

    // Obtain or create and register package
    AndroAppDslPackageImpl theAndroAppDslPackage = (AndroAppDslPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AndroAppDslPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AndroAppDslPackageImpl());

    isInited = true;

    // Initialize simple dependencies
    AndroDataDslPackage.eINSTANCE.eClass();
    AndroGuiDslPackage.eINSTANCE.eClass();

    // Create package meta-data objects
    theAndroAppDslPackage.createPackageContents();

    // Initialize created meta-data
    theAndroAppDslPackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theAndroAppDslPackage.freeze();

  
    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(AndroAppDslPackage.eNS_URI, theAndroAppDslPackage);
    return theAndroAppDslPackage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getAndroidApplication()
  {
    return androidApplicationEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getAndroidApplication_Imports()
  {
    return (EReference)androidApplicationEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getAndroidApplication_Name()
  {
    return (EAttribute)androidApplicationEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getAndroidApplication_Dataroot()
  {
    return (EReference)androidApplicationEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getAndroidApplication_MainActivity()
  {
    return (EReference)androidApplicationEClass.getEStructuralFeatures().get(3);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getAndroidApplication_ModelElements()
  {
    return (EReference)androidApplicationEClass.getEStructuralFeatures().get(4);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getModelElement()
  {
    return modelElementEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getActivity()
  {
    return activityEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getActivity_Name()
  {
    return (EAttribute)activityEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getActivity_Layout()
  {
    return (EReference)activityEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroAppDslFactory getAndroAppDslFactory()
  {
    return (AndroAppDslFactory)getEFactoryInstance();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isCreated = false;

  /**
   * Creates the meta-model objects for the package.  This method is
   * guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void createPackageContents()
  {
    if (isCreated) return;
    isCreated = true;

    // Create classes and their features
    androidApplicationEClass = createEClass(ANDROID_APPLICATION);
    createEReference(androidApplicationEClass, ANDROID_APPLICATION__IMPORTS);
    createEAttribute(androidApplicationEClass, ANDROID_APPLICATION__NAME);
    createEReference(androidApplicationEClass, ANDROID_APPLICATION__DATAROOT);
    createEReference(androidApplicationEClass, ANDROID_APPLICATION__MAIN_ACTIVITY);
    createEReference(androidApplicationEClass, ANDROID_APPLICATION__MODEL_ELEMENTS);

    modelElementEClass = createEClass(MODEL_ELEMENT);

    activityEClass = createEClass(ACTIVITY);
    createEAttribute(activityEClass, ACTIVITY__NAME);
    createEReference(activityEClass, ACTIVITY__LAYOUT);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isInitialized = false;

  /**
   * Complete the initialization of the package and its meta-model.  This
   * method is guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void initializePackageContents()
  {
    if (isInitialized) return;
    isInitialized = true;

    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Obtain other dependent packages
    CommonsPackage theCommonsPackage = (CommonsPackage)EPackage.Registry.INSTANCE.getEPackage(CommonsPackage.eNS_URI);
    AndroDataDslPackage theAndroDataDslPackage = (AndroDataDslPackage)EPackage.Registry.INSTANCE.getEPackage(AndroDataDslPackage.eNS_URI);
    AndroGuiDslPackage theAndroGuiDslPackage = (AndroGuiDslPackage)EPackage.Registry.INSTANCE.getEPackage(AndroGuiDslPackage.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    activityEClass.getESuperTypes().add(this.getModelElement());

    // Initialize classes and features; add operations and parameters
    initEClass(androidApplicationEClass, AndroidApplication.class, "AndroidApplication", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getAndroidApplication_Imports(), theCommonsPackage.getImport(), null, "imports", null, 0, -1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getAndroidApplication_Name(), ecorePackage.getEString(), "name", null, 0, 1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getAndroidApplication_Dataroot(), theAndroDataDslPackage.getAndroDataModelRoot(), null, "dataroot", null, 0, 1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getAndroidApplication_MainActivity(), this.getActivity(), null, "mainActivity", null, 0, 1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getAndroidApplication_ModelElements(), this.getModelElement(), null, "modelElements", null, 0, -1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(modelElementEClass, ModelElement.class, "ModelElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(activityEClass, Activity.class, "Activity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getActivity_Name(), ecorePackage.getEString(), "name", null, 0, 1, Activity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getActivity_Layout(), theAndroGuiDslPackage.getLayout(), null, "layout", null, 0, 1, Activity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    // Create resource
    createResource(eNS_URI);
  }

} //AndroAppDslPackageImpl
